//
//  SharedViewController.m
//  KYProject
//
//  Created by Roman on 16/12/20.
//  Copyright © 2016年 Roman. All rights reserved.
//

#import "SharedViewController.h"
#import "SharedBarView.h"
#import "DefineConstant.h"

@implementation SharedViewController


#pragma mark - 屏蔽父类viewdidload方法 (父类中将背景设为白色)
- (void)viewDidLoad {

}
#pragma mark - 构造方法
- (instancetype)init
{
    if (self = [super init]) {
        [self setupUI];
    }
    return self;
}

#pragma mark - 搭建UI
- (void)setupUI
{
    //遮罩
    UIView *coverView = [[UIView alloc]initWithFrame:KeyWindow.frame];
    [self.view addSubview:coverView];
    
    coverView.backgroundColor = [UIColor blackColor];
    coverView.alpha = 0;
    
    //底部弹出分享view
    SharedBarView *barView = [SharedBarView barView];
    [self.view addSubview:barView];
    
    barView.frame = CGRectMake(0, KeyWindow.height, KeyWindow.width, 80);
    barView.backgroundColor = [UIColor whiteColor];
    //动画
    [UIView animateWithDuration:0.25 animations:^{
        coverView.alpha = 0.5;
        barView.transform = CGAffineTransformMakeTranslation(0, -80);
    }];
    _coverView = coverView;
    _barView = barView;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
